<template>
    <div>
        <el-form
                ref="dataForm"
                status-icon
                :model="form"
                :rules="rules"
                label-width="0px"
        >
            <template>
                <div>
                    <h5>基本信息</h5>
                    <el-divider></el-divider>
                </div>
            </template>
            <el-descriptions :column="4" border>
                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"> 姓名</template>
                    <div>{{form.name}}</div>
                </el-descriptions-item>
                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label">身份证号码</template>
                    <div>{{form.sfz}}</div>
                </el-descriptions-item>
                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label">系统唯一识别码</template>
                    <div>{{form.id_num}}</div>
                </el-descriptions-item>
                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label">电话号码</template>
                    <div>{{form.phone}}</div>
                </el-descriptions-item>
                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 90%" span="4">
                    <template slot="label">联系地址</template>
                    <div>{{form.province_name}} {{form.city_name}} {{form.district_name}} {{form.town_name}}
                        {{form.village_name}} {{form.address}}
                    </div>
                </el-descriptions-item>
            </el-descriptions>

            <template>
                <div>
                    <h5>CT检查记录</h5>
                    <el-divider></el-divider>
                </div>
            </template>
            <el-descriptions :column="4" border>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> CT片号</template>
                    <el-form-item prop="ct_id">
                        <el-input v-model="form.ct_id" placeholder="请输入CT片号"></el-input>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> CT检查类型</template>
                    <el-form-item prop="ct_type">
                        <el-select clearable placeholder="请选择" style="width: 100%" v-model="form.ct_type"
                                   @change="changeCtType()">
                            <el-option
                                    :key="item.value"
                                    :label="item.text"
                                    :value="item.value"
                                    v-for="item in ctTypeList"
                            >
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> 其他类型</template>
                    <el-form-item prop="ct_type_other">
                        <el-input :disabled="form.ct_type!='5'" v-model="form.ct_type_other"
                                  placeholder="请输入其他类型"></el-input>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> CT检查日期</template>
                    <el-form-item prop="ct_date">
                        <el-date-picker
                                style="width:100%"
                                v-model="form.ct_date"
                                type="date"
                                placeholder="选择日期"
                                :value-format="'yyyy-MM-dd'"
                                clearable
                        >
                        </el-date-picker>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> CT检查目的</template>
                    <el-form-item prop="ct_objective">
                        <el-select clearable placeholder="请选择" style="width: 100%" v-model="form.ct_objective">
                            <el-option
                                    :key="item.id"
                                    :label="item.name"
                                    :value="item.id"
                                    v-for="item in lungCancerInfo.ctPurposeAry"
                            >
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> 管电压(kVp)</template>
                    <el-form-item prop="tube_voltage">
                        <el-input type="number" v-model="form.tube_voltage" placeholder="请输入管电压"></el-input>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> 管电流(mAs)</template>
                    <el-form-item prop="tube_current">
                        <el-input type="number" v-model="form.tube_current" placeholder="请输入管电流"></el-input>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> 层厚(mm)</template>
                    <el-form-item prop="seam_thickness">
                        <el-input type="number" v-model="form.seam_thickness" placeholder="请输入层厚"></el-input>
                    </el-form-item>
                </el-descriptions-item>
            </el-descriptions>

            <el-descriptions :column="4" border>
                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 90%">
                    <template slot="label"> 结节</template>
                    <el-table :data="form.sarcoidosis" style="width: 100%">
                        <template slot="empty">
                            <div class="emptyText">暂无数据</div>
                            <el-button type="primary" @click="addSarcoidosisItem()">添加</el-button>
                        </template>
                        <el-table-column prop="index" label="序号">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.index" placeholder="请输入序号"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column prop="location" label="位置">
                            <template slot-scope="scope">
                                <el-select clearable placeholder="请选择" style="width: 100%"
                                           v-model="scope.row.location">
                                    <el-option
                                            :key="item.value"
                                            :label="item.text"
                                            :value="item.value"
                                            v-for="item in sarcoidosisLocation"
                                    >
                                    </el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column prop="plies" label="层数">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.plies" placeholder="请输入层数"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column prop="edge_case" label="边缘情况">
                            <template slot-scope="scope">
                                <el-select clearable placeholder="请选择" style="width: 100%"
                                           v-model="scope.row.edge_case">
                                    <el-option
                                            :key="item.value"
                                            :label="item.text"
                                            :value="item.value"
                                            v-for="item in sarcoidosisEdgeCase"
                                    >
                                    </el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column prop="density" label="密度">
                            <template slot-scope="scope">
                                <el-select clearable placeholder="请选择" style="width: 100%"
                                           v-model="scope.row.density">
                                    <el-option
                                            :key="item.value"
                                            :label="item.text"
                                            :value="item.value"
                                            v-for="item in sarcoidosisDensity"
                                    >
                                    </el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column prop="len" label="最长径(mm)">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.len" placeholder="请输入最长径(mm)"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column prop="width" label="最短径(mm)">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.width" placeholder="请输入最短径(mm)"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column prop="volume" label="体积(mm³)">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.volume" placeholder="请输入体积(mm³)"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column prop="character" label="生长特性">
                            <template slot-scope="scope">
                                <el-select clearable placeholder="请选择" style="width: 100%"
                                           v-model="scope.row.character">
                                    <el-option
                                            :key="item.value"
                                            :label="item.text"
                                            :value="item.value"
                                            v-for="item in sarcoidosisCharacter"
                                    >
                                    </el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column prop="vdt" label="结节容积倍增时间VDT（天）">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.vdt" placeholder="请输入在上次CT报告中的ID"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column prop="ctid" label="在上次CT报告中的ID">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.ctid" placeholder="请输入在上次CT报告中的ID"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column label="操作" width="100">
                            <template slot-scope="scope">
                                <el-button
                                        type="primary"
                                        class="el-icon-plus"
                                        @click="addSarcoidosisItem()"
                                        size="small"
                                        v-if="scope.$index == 0"
                                >添加
                                </el-button>
                                <el-button
                                        type="danger"
                                        class="el-icon-minus"
                                        @click="deleteSarcoidosisItem(scope.$index)"
                                        size="small"
                                        v-else
                                >删除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-descriptions-item>
            </el-descriptions>

            <el-descriptions :column="4" border>
                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 90%">
                    <template slot="label"> 淋巴结</template>

                    <el-table :data="form.lymph" style="width: 100%">
                        <template slot="empty">
                            <div class="emptyText">暂无数据</div>
                            <el-button type="primary" @click="addLymphItem()">添加</el-button>
                        </template>
                        <el-table-column prop="index" label="序号">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.index" placeholder="请输入序号"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column prop="location" label="位置">
                            <template slot-scope="scope">
                                <el-select clearable placeholder="请选择" style="width: 100%" v-model="scope.row.location">
                                    <el-option
                                            :key="item.value"
                                            :label="item.text"
                                            :value="item.value"
                                            v-for="item in sarcoidosisLocation"
                                    >
                                    </el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column prop="partition" label="分区">
                            <template slot-scope="scope">
                                <el-select clearable placeholder="请选择" style="width: 100%"
                                           v-model="scope.row.partition">
                                    <el-option
                                            :key="item.value"
                                            :label="item.text"
                                            :value="item.value"
                                            v-for="item in lymphPartition"
                                    >
                                    </el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column prop="edge_case" label="包膜边缘">
                            <template slot-scope="scope">
                                <el-select clearable placeholder="请选择" style="width: 100%"
                                           v-model="scope.row.edge_case">
                                    <el-option
                                            :key="item.value"
                                            :label="item.text"
                                            :value="item.value"
                                            v-for="item in lymphEdgeCase"
                                    >
                                    </el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column prop="mediastinal_lymph" label="纵膈淋巴结分布">
                            <template slot-scope="scope">
                                <el-select clearable placeholder="请选择" style="width: 100%" v-model="scope.row.density">
                                    <el-option
                                            :key="item.value"
                                            :label="item.text"
                                            :value="item.value"
                                            v-for="item in lymphMediastinalLymph"
                                    >
                                    </el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column prop="len" label="最长径(mm)">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.len" placeholder="请输入最长径(mm)"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column prop="width" label="最短径(mm)">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.width" placeholder="请输入最短径(mm)"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column prop="volume" label="体积(mm³)">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.volume" placeholder="请输入体积(mm³)"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column prop="character" label="生长特性">
                            <template slot-scope="scope">
                                <el-select clearable placeholder="请选择" style="width: 100%"
                                           v-model="scope.row.character">
                                    <el-option
                                            :key="item.value"
                                            :label="item.text"
                                            :value="item.value"
                                            v-for="item in lymphCharacter"
                                    >
                                    </el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column prop="ctid" label="在上次CT报告中的ID">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.ctid" placeholder="请输入在上次CT报告中的ID"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column label="操作" width="100">
                            <template slot-scope="scope">
                                <el-button
                                        type="primary"
                                        class="el-icon-plus"
                                        @click="addLymphItem()"
                                        size="small"
                                        v-if="scope.$index == 0"
                                >添加
                                </el-button>
                                <el-button
                                        type="danger"
                                        class="el-icon-minus"
                                        @click="deleteLymphItem(scope.$index)"
                                        size="small"
                                        v-else
                                >删除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-descriptions-item>
            </el-descriptions>

            <el-descriptions :column="4" border>
                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 90%">
                    <template slot="label"> 肿块</template>
                    <el-table :data="form.lump" style="width: 100%">
                        <template slot="empty">
                            <div class="emptyText">暂无数据</div>
                            <el-button type="primary" @click="addLumpItem()">添加</el-button>
                        </template>
                        <el-table-column prop="index" label="序号">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.index" placeholder="请输入序号"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column prop="location" label="位置">
                            <template slot-scope="scope">
                                <el-select clearable placeholder="请选择" style="width: 100%" v-model="scope.row.location">
                                    <el-option
                                            :key="item.value"
                                            :label="item.text"
                                            :value="item.value"
                                            v-for="item in lumpLocation"
                                    >
                                    </el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column prop="edge_case" label="边缘情况">
                            <template slot-scope="scope">
                                <el-select clearable placeholder="请选择" style="width: 100%"
                                           v-model="scope.row.edge_case">
                                    <el-option
                                            :key="item.value"
                                            :label="item.text"
                                            :value="item.value"
                                            v-for="item in sarcoidosisEdgeCase"
                                    >
                                    </el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column prop="density" label="密度">
                            <template slot-scope="scope">
                                <el-select clearable placeholder="请选择" style="width: 100%" v-model="scope.row.density">
                                    <el-option
                                            :key="item.value"
                                            :label="item.text"
                                            :value="item.value"
                                            v-for="item in lumpDensity"
                                    >
                                    </el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column prop="pleura" label="胸膜牵拉征">
                            <template slot-scope="scope">
                                <el-select clearable placeholder="请选择" style="width: 100%" v-model="scope.row.pleura">
                                    <el-option
                                            :key="item.value"
                                            :label="item.text"
                                            :value="item.value"
                                            v-for="item in lumpPleura"
                                    >
                                    </el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column prop="len" label="最长径(mm)">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.len" placeholder="请输入最长径(mm)"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column prop="width" label="最短径(mm)">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.width" placeholder="请输入最短径(mm)"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column prop="volume" label="体积(mm³)">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.volume" placeholder="请输入体积(mm³)"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column prop="ctid" label="在上次CT报告中的ID">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.ctid" placeholder="请输入在上次CT报告中的ID"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column label="操作" width="100">
                            <template slot-scope="scope">
                                <el-button
                                        type="primary"
                                        class="el-icon-plus"
                                        @click="addLumpItem()"
                                        size="small"
                                        v-if="scope.$index == 0"
                                >添加
                                </el-button>
                                <el-button
                                        type="danger"
                                        class="el-icon-minus"
                                        @click="deleteLumpItem(scope.$index)"
                                        size="small"
                                        v-else
                                >删除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-descriptions-item>
            </el-descriptions>

            <template>
                <div>
                    <h5>其他发现</h5>
                    <el-divider></el-divider>
                </div>
            </template>
            <el-descriptions :column="4" border>
                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> 胸水</template>
                    <el-form-item prop="hydrothorax">
                        <el-radio-group v-model="form.hydrothorax">
                            <el-radio
                                    v-for="(item, index) in commonList"
                                    :key="index"
                                    :label="item.value"
                            >{{ item.text }}
                            </el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> 远端阻塞性肺炎</template>
                    <el-form-item prop="obstructive_pneumonia">
                        <el-radio-group v-model="form.obstructive_pneumonia">
                            <el-radio
                                    v-for="(item, index) in commonList"
                                    :key="index"
                                    :label="item.value"
                            >{{ item.text }}
                            </el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> 腹膜结节</template>
                    <el-form-item prop="peritoneum">
                        <el-radio-group v-model="form.peritoneum">
                            <el-radio
                                    v-for="(item, index) in commonList"
                                    :key="index"
                                    :label="item.value"
                            >{{ item.text }}
                            </el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-descriptions-item>


                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> 肺不张</template>
                    <el-form-item prop="pulmonary_atelectasis">
                        <el-radio-group v-model="form.pulmonary_atelectasis">
                            <el-radio
                                    v-for="(item, index) in commonList"
                                    :key="index"
                                    :label="item.value"
                            >{{ item.text }}
                            </el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> 支气管阻塞</template>
                    <el-form-item prop="bronchial_obstruction">
                        <el-radio-group v-model="form.bronchial_obstruction">
                            <el-radio
                                    v-for="(item, index) in commonList"
                                    :key="index"
                                    :label="item.value"
                            >{{ item.text }}
                            </el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> 肺气肿</template>
                    <el-form-item prop="emphysema">
                        <el-radio-group v-model="form.emphysema">
                            <el-radio
                                    v-for="(item, index) in commonList"
                                    :key="index"
                                    :label="item.value"
                            >{{ item.text }}
                            </el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> 官腔狭窄</template>
                    <el-form-item prop="bureaucratic_tone">
                        <el-radio-group v-model="form.bureaucratic_tone">
                            <el-radio
                                    v-for="(item, index) in commonList"
                                    :key="index"
                                    :label="item.value"
                            >{{ item.text }}
                            </el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> 肺间质纤维化</template>
                    <el-form-item prop="pulmonary_interstitial_fibrosis">
                        <el-radio-group v-model="form.pulmonary_interstitial_fibrosis">
                            <el-radio
                                    v-for="(item, index) in commonList"
                                    :key="index"
                                    :label="item.value"
                            >{{ item.text }}
                            </el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> 管壁增厚</template>
                    <el-form-item prop="tube_wall">
                        <el-radio-group v-model="form.tube_wall">
                            <el-radio
                                    v-for="(item, index) in commonList"
                                    :key="index"
                                    :label="item.value"
                            >{{ item.text }}
                            </el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                </el-descriptions-item>
                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                </el-descriptions-item>
                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                </el-descriptions-item>
            </el-descriptions>

            <el-descriptions :column="4" border>

                <el-descriptions-item span="2" labelStyle="width: 10%" contentStyle="width: 40%">
                    <template slot="label"> 气道意见</template>
                    <el-form-item prop="air_flue_opinion">
                        <el-input v-model="form.air_flue_opinion" type="textarea" placeholder="请输入气道意见"></el-input>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item span="2" labelStyle="width: 10%" contentStyle="width: 40%">
                    <template slot="label"> 随诊意见</template>
                    <el-form-item prop="clinic_opinion">
                        <el-input v-model="form.clinic_opinion" type="textarea" placeholder="请输入随诊意见"></el-input>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item span="2" labelStyle="width: 10%" contentStyle="width: 40%">
                    <template slot="label"> 检查所见</template>
                    <el-form-item prop="examination_finding">
                        <el-input v-model="form.examination_finding" type="textarea" placeholder="请输入检查所见"></el-input>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item span="2" labelStyle="width: 10%" contentStyle="width: 40%">
                    <template slot="label"> 影像学诊断</template>
                    <el-form-item prop="imaging_diagnosis">
                        <el-input v-model="form.imaging_diagnosis" type="textarea" placeholder="请输入影像学诊断"></el-input>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> 报告日期</template>
                    <el-form-item prop="report_date">
                        <el-date-picker
                                style="width:100%"
                                v-model="form.report_date"
                                type="date"
                                placeholder="选择日期"
                                :value-format="'yyyy-MM-dd'"
                                clearable
                        >
                        </el-date-picker>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> 报告医师</template>
                    <el-form-item prop="report_doctor">
                        <el-select clearable placeholder="请选择" style="width: 100%" v-model="form.report_doctor">
                            <el-option
                                    :key="item.id"
                                    :label="item.name"
                                    :value="item.name"
                                    v-for="item in memberList"
                            >
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> 建议纤维支气管镜</template>
                    <el-form-item prop="bronchoscope">
                        <el-radio-group v-model="form.bronchoscope">
                            <el-radio
                                    v-for="(item, index) in commonList1"
                                    :key="index"
                                    :label="item.value"
                            >{{ item.text }}
                            </el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-descriptions-item>

                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 15%">
                    <template slot="label"><span class="red">*</span> 是否筛查阳性</template>
                    <el-form-item prop="is_lung_cancer">
                        <el-radio-group v-model="form.is_lung_cancer">
                            <el-radio
                                    v-for="(item, index) in commonList1"
                                    :key="index"
                                    :label="item.value"
                            >{{ item.text }}
                            </el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-descriptions-item>

            </el-descriptions>

            <el-descriptions :column="1" border v-if="dialogStatus !== 'formal'">
                <el-descriptions-item labelStyle="width: 10%" contentStyle="width: 90%">
                    <el-form-item label=" ">
                        <el-button @click="handleDialogVisible(false)" size="small">取 消</el-button>
                        <el-button
                                type="primary"
                                @click="update()"
                                size="small"
                        >确 定
                        </el-button>
                    </el-form-item>
                </el-descriptions-item>
            </el-descriptions>
        </el-form>

    </div>
</template>

<script>
    import {createData, updateData} from '@/api/data/data';
    import {listMember} from "@/api/member/member";
    import {lungCancerInfo} from "@/common/lungCancerInfo"
    import moment from "moment";

    export default {
        props: ["rowData", "dialogStatus"],
        components: {},
        data() {
            return {
                form: {
                    id: "",
                    ct_id: "",    //CTID
                    ct_type: "",    //CT检查类型
                    ct_type_other: "",    //CT其他类型
                    ct_date: "",    //CT检查日期
                    ct_objective: "",    //CT检查目的
                    tube_voltage: "",    //管电压
                    tube_current: "",    //管电流
                    seam_thickness: "",    //层厚
                    sarcoidosis: [],    //结节
                    lymph: [],    //淋巴结
                    lump: [],    //肿块
                    hydrothorax: 0,    //胸水
                    obstructive_pneumonia: 0,    //远端阻塞性肺炎
                    peritoneum: 0,    //腹膜结节
                    pulmonary_atelectasis: 0,    //肺不张
                    bronchial_obstruction: 0,    //支气管阻塞
                    emphysema: 0,    //肺气肿
                    bureaucratic_tone: 0,    //官腔狭窄
                    pulmonary_interstitial_fibrosis: 0,    //肺间质纤维化
                    tube_wall: 0,    //管壁增厚
                    air_flue_opinion: "",    //气道意见
                    clinic_opinion: "",    //随诊意见
                    examination_finding: "",    //检查所见
                    imaging_diagnosis: "",    //影像学诊断
                    ct_status: 0,    //CT状态
                    report_date: "",    //报告日期
                    report_doctor: "",  //报告医生
                    is_lung_cancer: 0,  //是否疑似肺癌
                    bronchoscope: 0,  //建议纤维支气管镜
                    treatment: 0,  //治疗
                    follow_up: 0,  //随访
                    follow_date: "",  //随访时间
                    scene: 'ct',
                },
                rules: {
                    ct_id: [{required: true, trigger: "blur", message: "请输入CT片号"}],
                    ct_type: [{required: true, trigger: "blur", message: "请输入CT检查类型"}],
                    ct_date: [{required: true, trigger: "blur", message: "请输入CT检查日期"}],
                    ct_type_other: [{required: false, trigger: "blur", message: "请输入CT其他类型"}],
                    ct_objective: [{required: false, trigger: "blur", message: "请输入CT检查目的"},
                        {required: true, validator: (rule, value, callback) => {
                            if(value!=3){
                                if(this.form.screening_type==1) {
                                    if(value!=1) {
                                        callback(new Error("ct检查目的与筛查类型不一致1"))
                                        return
                                    }
                                } else {
                                    if(value==1){
                                        callback(new Error("ct检查目的与筛查类型不一致2"))
                                        return
                                    }
                                }
                            }
                            callback()
                        }, trigger: "blur"}],
                    tube_voltage: [{required: true, trigger: "blur", message: "请输入管电压"}],
                    tube_current: [{required: true, trigger: "blur", message: "请输入管电流"}],
                    seam_thickness: [{required: true, trigger: "blur", message: "请输入层厚"}],
                    hydrothorax: [{required: true, trigger: "blur", message: "请输入胸水"}],
                    obstructive_pneumonia: [{required: true, trigger: "blur", message: "请输入远端阻塞性肺炎"}],
                    peritoneum: [{required: true, trigger: "blur", message: "请输入腹膜结节"}],
                    pulmonary_atelectasis: [{required: true, trigger: "blur", message: "请输入肺不张"}],
                    bronchial_obstruction: [{required: true, trigger: "blur", message: "请输入支气管阻塞"}],
                    emphysema: [{required: true, trigger: "blur", message: "请输入肺气肿"}],
                    bureaucratic_tone: [{required: true, trigger: "blur", message: "请输入官腔狭窄"}],
                    pulmonary_interstitial_fibrosis: [{required: true, trigger: "blur", message: "请输入肺间质纤维化"}],
                    tube_wall: [{required: true, trigger: "blur", message: "请输入管壁增厚"}],
                    report_date: [{required: true, trigger: "blur", message: "请输入报告日期"}],
                    report_doctor: [{required: true, trigger: "blur", message: "请输入报告医生"}],
                    bronchoscope: [{required: true, trigger: "blur", message: "请输入建议纤维支气管镜"}],
                    is_lung_cancer: [{required: true, trigger: "blur", message: "请输入是否筛查阳性"},
                        {required: true, validator: (rule, value, callback) => {
                            if(this.form.screening_type==1) {       //基线筛查
                                if(value==0) {  //筛查结论为阴性
                                    if(this.form.obstructive_pneumonia==1) {
                                        callback(new Error("筛查结论与远端阻塞性肺炎矛盾"))
                                        return
                                    }
                                    if(this.form.pulmonary_atelectasis==1) {
                                        callback(new Error("筛查结论与肺不张矛盾"))
                                        return
                                    }
                                    if(this.form.bronchial_obstruction==1) {
                                        callback(new Error("筛查结论与支气管阻塞矛盾"))
                                        return
                                    }
                                    if(this.form.bureaucratic_tone==1) {
                                        callback(new Error("筛查结论与官腔狭窄矛盾"))
                                        return
                                    }
                                    if(this.form.tube_wall==1) {
                                        callback(new Error("筛查结论与管壁增厚矛盾"))
                                        return
                                    }
                                    if(this.form.sarcoidosis[0]) {
                                        if(this.form.sarcoidosis[0].len>=15) {
                                            callback(new Error("筛查结论与结节性质矛盾"))
                                            return
                                        } else {
                                            switch(this.form.sarcoidosis[0].density) {
                                                case 1:     //实性结节
                                                case 2:     //部分实性结节
                                                    if(this.form.sarcoidosis[0].len>=5) {
                                                        callback(new Error("筛查结论与结节性质矛盾"))
                                                        return
                                                    }
                                                    break
                                                case 3:
                                                case 4:     //毛玻璃结节
                                                    if(this.form.sarcoidosis[0].len>=8 ) {
                                                        callback(new Error("筛查结论与结节性质矛盾"))
                                                        return
                                                    }
                                                    break
                                                default:
                                            }
                                        }
                                    }
                                }
                            } else {    //年度或复查
                                if(value==0) {  //筛查结论为阴性
                                    if(this.form.obstructive_pneumonia==1) {
                                        callback(new Error("筛查结论与远端阻塞性肺炎矛盾"))
                                        return
                                    }
                                    if(this.form.pulmonary_atelectasis==1) {
                                        callback(new Error("筛查结论与肺不张矛盾"))
                                        return
                                    }
                                    if(this.form.bronchial_obstruction==1) {
                                        callback(new Error("筛查结论与支气管阻塞矛盾"))
                                        return
                                    }
                                    if(this.form.bureaucratic_tone==1) {
                                        callback(new Error("筛查结论与官腔狭窄矛盾"))
                                        return
                                    }
                                    if(this.form.tube_wall==1) {
                                        callback(new Error("筛查结论与管壁增厚矛盾"))
                                        return
                                    }
                                    if(this.form.sarcoidosis.length>0){
                                        switch(this.form.sarcoidosis[0].character) {
                                            case 1:     //新节点
                                                if(this.form.sarcoidosis[0].density!=3 ) {
                                                    callback(new Error("筛查结论与结节性质矛盾"))
                                                    return
                                                }
                                                break;
                                            case 2:     //较上次检查增大
                                            case 6:     //较上次检查实性成分增加
                                                callback(new Error("筛查结论与结节性质矛盾"))
                                                return
                                            default:
                                        }
                                    }
                                }
                            }
                            callback()
                        }, trigger: "blur"}]
                },
                updateLoading: false,
                memberList: [],
                ctTypeList: [
                    {text: "平扫", value: 1},
                    {text: "增强", value: 2},
                    {text: "血管", value: 3},
                    {text: "CTA检查", value: 4},
                    {text: "其他", value: 5}
                ],
                commonList: [
                    {text: "无", value: 0},
                    {text: "有", value: 1}
                ],
                commonList1: [
                    {text: "否", value: 0},
                    {text: "是", value: 1}
                ],
                //位置
                sarcoidosisLocation: [
                    {
                        value: 1,
                        text: "右肺上叶"
                    },
                    {
                        value: 2,
                        text: "右肺中叶"
                    },
                    {
                        value: 3,
                        text: "右肺下叶"
                    },
                    {
                        value: 4,
                        text: "左肺上叶"
                    },
                    {
                        value: 5,
                        text: "左肺下叶"
                    },
                ],
                //边缘情况
                sarcoidosisEdgeCase: [
                    {
                        value: 1,
                        text: "光滑"
                    },
                    {
                        value: 2,
                        text: "分叶"
                    },
                    {
                        value: 3,
                        text: "毛刺"
                    },
                    {
                        value: 4,
                        text: "不规则"
                    },
                ],
                //密度
                sarcoidosisDensity: [
                    {
                        value: 1,
                        text: "实性结节"
                    },
                    {
                        value: 2,
                        text: "部分实性结节"
                    },
                    {
                        value: 3,
                        text: "钙化结节"
                    },
                    {
                        value: 4,
                        text: "毛玻璃结节"
                    },
                ],
                //生长特性
                sarcoidosisCharacter: [
                    {
                        value: 1,
                        text: "新结节"
                    },
                    {
                        value: 2,
                        text: "较上次检查增大"
                    },
                    {
                        value: 3,
                        text: "较上次检查没有变"
                    },
                    {
                        value: 4,
                        text: "较上次检查减小"
                    },
                    {
                        value: 6,
                        text: "较上次实性成分增加"
                    },
                    {
                        value: 5,
                        text: "不确定"
                    }
                ],
                //分区
                lymphPartition: [
                    {
                        value: 1,
                        text: "1组"
                    },
                    {
                        value: 2,
                        text: "2组"
                    },
                    {
                        value: 3,
                        text: "3组"
                    },
                    {
                        value: 4,
                        text: "4组"
                    },
                    {
                        value: 5,
                        text: "5组"
                    },
                    {
                        value: 6,
                        text: "6组"
                    },
                    {
                        value: 7,
                        text: "7组"
                    },
                    {
                        value: 8,
                        text: "8组"
                    },
                    {
                        value: 9,
                        text: "9组"
                    },
                    {
                        value: 10,
                        text: "10组"
                    },
                    {
                        value: 11,
                        text: "11组"
                    },
                    {
                        value: 12,
                        text: "12组"
                    },
                    {
                        value: 13,
                        text: "13组"
                    },
                    {
                        value: 14,
                        text: "14组"
                    },
                ],
                //包膜边缘
                lymphEdgeCase: [
                    {
                        value: 1,
                        text: "毛糙"
                    },
                    {
                        value: 2,
                        text: "光滑"
                    }
                ],
                //纵膈淋巴结分布
                lymphMediastinalLymph: [
                    {
                        value: 1,
                        text: "单站肿大"
                    },
                    {
                        value: 2,
                        text: "多站融合"
                    },
                    {
                        value: 3,
                        text: "多站肿大"
                    }
                ],
                //生长特性
                lymphCharacter: [
                    {
                        value: 1,
                        text: "孤立"
                    },
                    {
                        value: 2,
                        text: "融合"
                    }
                ],
                //位置
                lumpLocation: [
                    {
                        value: 1,
                        text: "右肺上叶"
                    },
                    {
                        value: 2,
                        text: "右肺中叶"
                    },
                    {
                        value: 3,
                        text: "右肺下叶"
                    },
                    {
                        value: 4,
                        text: "左肺上叶"
                    },
                    {
                        value: 5,
                        text: "左肺下叶"
                    },
                    {
                        value: 6,
                        text: "左肺门区"
                    },
                    {
                        value: 7,
                        text: "右肺门区"
                    },
                    {
                        value: 8,
                        text: "纵膈内"
                    },
                ],
                //密度
                lumpDensity: [
                    {
                        value: 1,
                        text: "实性肿块"
                    },
                    {
                        value: 2,
                        text: "非实性肿块"
                    },
                    {
                        value: 3,
                        text: "部分实性肿块"
                    },
                    {
                        value: 4,
                        text: "钙化肿块"
                    },
                    {
                        value: 5,
                        text: "空洞肿块"
                    },
                ],
                //胸膜牵拉征
                lumpPleura: [
                    {
                        value: 1,
                        text: "典型胸膜牵拉征"
                    },
                    {
                        value: 2,
                        text: "线条状影"
                    },
                    {
                        value: 3,
                        text: "斜裂胸膜牵拉"
                    },
                    {
                        value: 4,
                        text: "复合型"
                    }
                ],
                lungCancerInfo: lungCancerInfo
            };
        },
        created() {
            this.getListMember();
            if (this.dialogStatus == "update" || this.dialogStatus == "formal") {
                this.form = {...this.rowData};
                this.form.sarcoidosis = this.form.sarcoidosis ? JSON.parse(this.form.sarcoidosis) : [];
                this.form.lymph = this.form.lymph ? JSON.parse(this.form.lymph) : [];
                this.form.lump = this.form.lump ? JSON.parse(this.form.lump) : [];
            }
        },
        mounted() {
        },
        computed: {},
        methods: {
            changeCtType() {
                if (this.form.ct_type != 5) {
                    this.rules.ct_type_other[0].required = false;
                } else {
                    this.rules.ct_type_other[0].required = true;
                }
            },
            addSarcoidosisItem() {
                this.form.sarcoidosis.push({
                    index: "",
                    location: "",
                    plies: "",
                    edge_case: "",
                    density: "",
                    len: "",
                    width: "",
                    volume: "",
                    character: "",
                    vdt: "",
                    ctid: ""
                });
            },
            deleteSarcoidosisItem(index) {
                this.form.sarcoidosis.splice(index, 1);
            },
            addLymphItem() {
                this.form.lymph.push({
                    index: "",
                    location: "",
                    partition: "",
                    edge_case: "",
                    mediastinal_lymph: "",
                    len: "",
                    width: "",
                    volume: "",
                    character: "",
                    ctid: ""
                });
            },
            deleteLymphItem(index) {
                this.form.lymph.splice(index, 1);
            },
            addLumpItem() {
                this.form.lump.push({
                    index: "",
                    location: "",
                    edge_case: "",
                    density: "",
                    pleura: "",
                    len: "",
                    width: "",
                    volume: "",
                    ctid: ""
                });
            },
            deleteLumpItem(index) {
                this.form.lump.splice(index, 1);
            },
            obtChange() {
                //console.log(this.form.obt, this.form.obt1, this.form.obt2)
                if (this.form.obt1 || this.form.obt2) {
                    this.form.obt = 1
                } else {
                    this.form.obt = 0
                }
            },
            getListMember() {
                let params = {
                    user_name: "",
                    status: "",
                    institution_id: this.$store.state.member.institution_id,
                    pageSize: 1000,
                    page: 1,
                }
                listMember(params).then(res => {
                    if (res.code === 200) {
                        this.memberList = res.data.data;
                    } else {
                        this.msgError(res.msg);
                    }
                });
            },
            //父页面的回调事件
            handleDialogVisible(isUpdate) {
                this.dialogVisible = false;
                this.$emit("childByDialogVisible", this.dialogVisible, isUpdate);
            },
            update() {  //修改
                this.form.scene = 'ct'
                this.$refs["dataForm"].validate((valid) => {
                    if (valid) {
                        this.updateLoading = true
                        updateData(this.form).then((response) => {
                            this.updateLoading = false
                            if (response.code == 200) {
                                this.msgSuccess(response.msg)
                                this.handleDialogVisible(true)
                            }
                        })
                    } else {
                        this.message("校验失败")
                    }
                })
            }
        },
        watch: {}
    }
</script>
<style lang="scss" scoped="scoped">
    .el-form-item {
        margin: 0px;
    }

    .red {
        color: red;
    }

    .el-form-item {
        margin: 0;
    }

    .el-ul {
        list-style: none;
        padding: 0;
    }

    .el-list-li {
        float: left;
        position: relative;
        padding: 10px 10px 0px 0px;
    }

    .el-icon-circle-close {
        position: absolute;
        top: 0px;
        right: 0px;
        z-index: 2;
        font-size: 20px;
    }

</style>
